package com.springboot.mybatis01helloworld.mapper;

import com.springboot.mybatis01helloworld.bean.Customer;
import com.springboot.mybatis01helloworld.bean.Order;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderCustomerMapper {
    //需求：按照id查询客户 以及 他下的所有订单
    //1. 查询客户
    Customer getCustomerById(Long id);

    //2. 查询订单
    List<Order> getOrdersByCustomerId(Long id);

    //3、分步查询：自动做两步 = 查询客户 + 查询客户下的订单
    Customer getCustomerByIdAndOrders(Long id);

    //4、分步查询：自动做两步 = 按照id查询订单 + 查询下单的客户
    Order getOrderByIdAndCustomerStep(Long id);

}
